package com.yq233.utills;


import com.alibaba.fastjson2.JSONObject;
import lombok.val;

import java.util.HashMap;
import java.util.Map;

public class Result {

    public static String okGetString(String message) {
        Map<String, Object> map = new HashMap<>();
        map.put("code", 200);
        map.put("message", message);
        val s = JSONObject.toJSONString(map);
        return s;
    }

    public static String okGetStringBydata(String message, Object data) {
        Map<String, Object> map = new HashMap<>();
        map.put("code", 200);
        map.put("message", message);
        map.put("data", data);
        val s = JSONObject.toJSONString(map);
        return s;
    }
}
